package com.krisyu.MementoPattern.template;

/**
 * @DATE 2022/1/8
 * @Author KrisYu
 * @Description
 */
public class User implements Restorable{
    private String state;

    @Override
    public Memento createMemento() {
        return new Memento(this.state);
    }

    @Override
    public void restoreMemento(Memento memento) {
        this.setState(memento.getState());
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
